package com.Inter.T02;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;
import java.util.Scanner;

public class Client {
    public static void main(String[] args) throws IOException {
        // 1. 创建socket对象
        Socket socket = new Socket("127.0.0.1", 10000);
        OutputStream os = socket.getOutputStream();

        // 2.写出数据
        Scanner sc = new Scanner(System.in);
        while (true) {
            System.out.println("请输入");
            String str = sc.nextLine();
            os.write(str.getBytes());

            if("88".equals(str)){
                break;
            }
        }

        // 释放资源
        socket.close();
    }
}
